import React from 'react';
import Icon from 'react-native-vector-icons/Feather';
import Btn from '../Button';

export default ({
  name,
  color = '#fff',
  size = 20,
  style = {},
  onPress = () => null,
  title,
  reverse,
  disabled,
}) => {
  return (
    <Btn
      onPress={onPress}
      disabled={disabled}
      type="primary"
      size="small"
      title={title}
      style={{
        flexDirection: reverse ? 'row' : 'row-reverse',
        marginHorizontal: 10
      }}
      icon={
        <Icon
          name={name}
          color={color}
          size={size}
          style={{
            [reverse ? 'marginRight' : 'marginLeft']: !!title ? 4 : 0,
            ...style
          }}
        />
      }
    />
  );
};
